#ifndef EVENT_H
#define EVENT_H

#include "system_config.h"

#if EVENT_RECORD_TYPE == 0
typedef unsigned char event_t;
#elif EVENT_RECORD_TYPE == 1
typedef unsigned short event_t;
#elif EVENT_RECORD_TYPE == 2
typedef unsigned int event_t;
#elif EVENT_RECORD_TYPE == 3
typedef unsigned long event_t;
#elif EVENT_RECORD_TYPE == 4
typedef unsigned long long event_t;
#endif
	

void event_manual_register(event_t evt, void handler());
event_t event_auto_register(void handler(), unsigned char auto_unregister);
event_t event_get();
void event_post(event_t evt);
void event_cancel(event_t evt);
void event_clear();
void event_pull();

#define event_unregister(evt)					event_manual_register(evt, 0)

//for backward compactibility
#define event_register(evt, handler) event_manual_register(evt, handler)

#endif // ENVENT_H